<h3 class="pageTitle"><?php echo $title; ?></h3>
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
	                                            'id'=>'item-edit-form',
                                                'enableClientValidation'=>true,
                                                'clientOptions'=>array(
                                                    'validateOnSubmit'=>true,
                                                    ),
      )); 
?>
    <?php echo CHtml::errorSummary($model); ?>
 
    <div class="row">
        <?php echo CHtml::activeLabel($model,'name'); ?>
        <?php echo CHtml::activeTextField($model,'name', array('size' => 30)) ?>
    </div>
    <?php if($model->isNewRecord) : ?>    
        <div class="row">
            <?php echo CHtml::activeLabel($model,'type'); ?>
            <?php echo $form->dropDownList($model, 
                                           'type', 
                                           array('0' => 'operation', '1' => 'task', '2' => 'role'));?>            
        </div>
    <?php endif; ?> 

    <div class="row">
        <?php echo CHtml::activeLabel($model,'description'); ?>
        <?php echo CHtml::activeTextArea($model,'description') ?>
    </div>

    <div class="row">
        <?php echo CHtml::activeLabel($model,'bizrule'); ?>
        <?php echo CHtml::activeTextField($model,'bizrule',array('size' => 40)) ?>
    </div>

    <div class="row">
        <?php echo CHtml::activeLabel($model,'data'); ?>
        <?php echo CHtml::activeTextArea($model,'data') ?>
    </div>

    <?php if($dropdown) : ?>
        <?php if($itemChild) : ?>
            <div class="row">
                <?php echo CHtml::activeLabel($itemChild,'parent'); ?>
                <?php echo $form->dropDownList($itemChild,'parent', $dropdown, array('empty' => 'Parent Item')); ?>
            </div>
        <?php endif; ?>
    <?php endif; ?>

    <div class="row submit">
        <?php echo CHtml::submitButton($model->isNewRecord ? 'Add' : 'Update', array('class' => 'button')); ?>
    </div>
<?php $this->endWidget(); ?> 
</div><!-- form -->

<button onclick="window.location='<?php echo $this->createAbsoluteUrl('authItem/index'); ?>'" class="button">Back to list</button>
